﻿// Version:1
// Author:Sanket Naik
// Date:July-21-2010 
// Comments:
// 
// 
// 


using System;
using ManagedServices.DataTransferObjects;
using ManagedServices.Common.DataTransferObject;

namespace ManagedServices.Persistence
{
    /// <summary>
    /// Represents a Unified Interface for all Data Gateway
    /// </summary>
    /// <typeparam name="TTypeOfDTO"></typeparam>
    public interface IDTOGateway<TTypeOfDTO> where TTypeOfDTO : ICommonDto
    {
        /// <summary>
        /// Saves a new Instance of the DTO to the Persistent Store
        /// </summary>
        /// <param name="dataTransferObjectInstance"></param>
        void Save(TTypeOfDTO dataTransferObjectInstance);

        /// <summary>
        /// Updates a new Instance of the DTO to the Persistent Store
        /// </summary>
        /// <param name="dataTransferObjectInstance"></param>
        void Update(TTypeOfDTO dataTransferObjectInstance);

        /// <summary>
        /// Deletes a new Instance of the DTO to the Persistent Store
        /// </summary>
        /// <param name="dataTransferObjectInstance"></param>
        void Delete(TTypeOfDTO dataTransferObjectInstance);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="primaryKeyId"></param>
        /// <returns></returns>
        TTypeOfDTO Retrieve(Guid primaryKeyId);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        TTypeOfDTO[] RetrieveAll();
    }
}